package com.boco.modules.fdoc.api;

import javax.annotation.Resource;

import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.boco.common.json.BaseJsonVo;
import com.boco.common.utils.JsonUtils;
import com.boco.modules.fdoc.service.AdService;
import com.wordnik.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(value = "/ad", produces = "text/json;charset=UTF-8")
public class AdApi {

	/**
	 *  首页广告信息
	 * @return
	 */
	
	@Resource
	AdService adService;
	
	@RequestMapping(value = "/getAds", method = RequestMethod.GET)
	@ApiOperation(value = "首页广告信息", notes = "{}", response = BaseJsonVo.class)
	public String getAds() {
		BaseJsonVo vo = new BaseJsonVo();
		BeanUtils.copyProperties(adService.getAds(), vo);
		return JsonUtils.getJson(BaseJsonVo.success(vo));
	}
}
